package psi

import "strings"

/*
白名单开关
[DW*YYYYYYYYYYYYYYY*LEN*WLKEY,ONOFF] ONOFF: 1:开启，0:关闭
实例:[DW*334588000000156*0008*WLKEY,1]
终端回复
[DW*YYYYYYYYYYYYYYY*LEN*WLKEY]
实例:[DW*334588000000156*0006*WLKEY]
*/

// 白名单开关
type WLKEY struct {
	Switch int // ONOFF: 1:开启，0:关闭
}

func DealWLKEY(method string, params map[string]interface{}) (string, error) {
	var wlkey WLKEY
	err := MapToStruct(params, &wlkey)
	if err != nil {
		return "", err
	}
	var messageList []string
	messageList = append(messageList, "WLKEY")
	messageList = append(messageList, "1")
	message := strings.Join(messageList, ",")
	return message, nil
}
